package cn.edu.scau.cmi.lixiaoyuan.orm.hibernate.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import cn.edu.scau.cmi.lixiaoyuan.orm.hibernate.factory.HibernateSessionFactory;

public class BaseHibernateDAO{
         public Session getSession() {
        	 Configuration config = new Configuration();
             config.configure("hibernate.cfg.xml");
             SessionFactory sf = config.buildSessionFactory();// 获取工厂
             Session session = sf.openSession();
             return session;
         }
}
